package shop;

public class Product {
	private Long id;
	private String name;
	private double price;

	public Product(Long id, String name, double price) {
		this.id = id;
		this.name = name;
		this.price = price;
	}

	public Long getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public double getPrice() {
		return price;
	}

	@Override
	public boolean equals(Object obj) {
		Product that = (Product) obj;
		return id == that.id && name.equals(that.name)
				&& price==that.price;

	}

	@Override
	public int hashCode() {
		return (id + name + price).hashCode();
	}
}
